home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 1999 May / maximum-cd-1999-05.iso / Canvas 6 / DATA1.CAB / English_Tutorial_Files / Viewpage / Colcab.cab / ColTxtFnt.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-10-10  |  1.5 KB  |  46 lines

  1. import java.awt.Font;
  2. import java.awt.Graphics;
  3. import java.awt.Rectangle;
  4. import java.io.DataInputStream;
  5. import java.io.IOException;
  6.  
  7. final class ColTxtFnt extends ColObj {
  8.    private int m_txtSz = 12;
  9.    private int m_txtFace;
  10.    private String m_txtFont = new String();
  11.    private ColGrph m_colGraphicObj;
  12.    public Rectangle m_bounds = new Rectangle();
  13.  
  14.    public void draw(Graphics var1) {
  15.       this.m_colGraphicObj.m_font = new Font(this.m_txtFont, this.m_txtFace, (int)((float)this.m_txtSz * this.m_colGraphicObj.m_mag));
  16.       this.m_colGraphicObj.m_fontMtrc = this.m_colGraphicObj.m_appComp.getFontMetrics(this.m_colGraphicObj.m_font);
  17.       var1.setFont(this.m_colGraphicObj.m_font);
  18.    }
  19.  
  20.    public int getType() {
  21.       return 12;
  22.    }
  23.  
  24.    public Rectangle getBounds() {
  25.       return this.m_bounds;
  26.    }
  27.  
  28.    public ColTxtFnt(DataInputStream var1, int var2, ColGrph var3, Graphics var4) throws IOException {
  29.       this.m_colGraphicObj = var3;
  30.       if ((var2 & 8) != 0) {
  31.          this.m_txtSz = var1.readInt();
  32.       }
  33.  
  34.       if ((var2 & 16) != 0) {
  35.          this.m_txtFace = var1.readInt();
  36.       }
  37.  
  38.       for(int var5 = var1.readShort(); var5 > 0; --var5) {
  39.          String var10001 = this.m_txtFont;
  40.          this.m_txtFont = var10001 + (char)var1.readShort();
  41.       }
  42.  
  43.       this.draw(var4);
  44.    }
  45. }
  46.